#ifndef __MY_COMMON_H_
#define __MY_COMMON_H_


#include "Global.h"


#define MY_TRUE		1
#define MY_FLASE	0

#define wb(addr, value)     (*((unsigned char  volatile *) (addr)) = value)
#define rb(addr)            (*((unsigned char  volatile *) (addr)))
#define whw(addr, value)    (*((unsigned short volatile *) (addr)) = value)
#define rhw(addr)           (*((unsigned short volatile *) (addr)))
#define ww(addr, value)     (*((unsigned long volatile *) (addr)) = value)
#define rw(addr)            (*((unsigned long volatile *) (addr)))



#define STR_MAX_LEN	(65536)
typedef char* STR_T;

void Str2Hex(char *pStr,unsigned char* des);
void Mem2Mem(unsigned char *Src,unsigned char* Des,int size);
unsigned char MemCmp(unsigned char *Src,unsigned char* Des,int size);
unsigned char MemCompare(unsigned char *Src,unsigned char* Des,int size);
int StrLen(STR_T pStr);
unsigned char MemCpy(void* pDes, void* pSrc, unsigned short size);
unsigned char HexAscii2Hex(unsigned char *pStr, unsigned char size);
void Hex_2_HexAscii(unsigned char src,unsigned char *pdes);
unsigned char strtok_ex(char *p,char *des,unsigned char  index,char *psign);
void str_16H_2_hex(char *psrc,char *pdes,unsigned char len);
void My_MemCpy(unsigned char *psrc,unsigned char *pdes,unsigned char len);


#endif
